﻿using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using UnityEngine;

public class OnceShotSkill : SkillBase {


    /// <summary>
    /// 释放技能
    /// </summary>
    /// <param name="pos">技能位置</param>
    /// <param name="targetDir">技能目标方向</param>
    /// <param name="moveDuration">移动时长</param>
    public override void Release(Vector3 pos, Vector3 targetDir, float moveDuration)
    {
        MyTran.position = pos;
        MyTran.LookAt(targetDir);
        moveTween = MyTran.DOMove(targetDir, moveDuration);
        moveTween.OnComplete(delegate { TweenEndAction(); });
        moveTween.SetEase(Ease.Linear);
        MyPar.Play();
    }


    /// <summary>
    /// 取消技能
    /// </summary>
    public override void DisableSkill()
    {
        moveTween.Complete();
    }
}
